using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using MacomberMap.Common.User_Interfaces.Components;

namespace MacomberMap.Common.User_Interfaces.One_Lines.Elements
{
    /// <summary>
    /// This class holds the resource name information for a special descriptor.
    /// </summary>
    public class MM_OneLine_SecondaryDescriptor: MM_OneLine_Descriptor
    {
        #region Initialization
        /// <summary>
        /// Initialize the descriptor
        /// </summary>
        /// <param name="ParentElement">The parent element for this item</param>
        /// <param name="ElemConfig">The configuration for the element</param>
        /// <param name="DisplayParameters">The display parameters for the element</param>        
        public MM_OneLine_SecondaryDescriptor(MM_OneLine_Element ParentElement, XmlElement ElemConfig, MM_OneLine_Display DisplayParameters) : base(ParentElement, ElemConfig, DisplayParameters) { }

        /// <summary>
        /// Initialize the descriptor
        /// </summary>
        /// <param name="ParentElement">The parent element for this item</param>
        /// <param name="DisplayParameters">The display parameters for the element</param>
        public MM_OneLine_SecondaryDescriptor(MM_OneLine_Element ParentElement, MM_OneLine_Display DisplayParameters) : base(ParentElement, DisplayParameters) { }
        #endregion

        #region Description
        /// <summary>
        /// Return a readable string
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            if (ParentElement == null)
                return "Unattached secondary descriptor";
            else if (ParentElement.BaseElement == null)
                return "Unknown secondary descriptor";
            else
                return ParentElement.BaseElement.Name + " " + this.Name + " Secondary Descriptor (" + this.TEID.ToString() + ")";
        }


        #endregion


    }
}
